use "bjkParser.sml";
use "bkj.ml";
use "CG.sml";

val c1 = CG.makeContext(5,[1,2]);
val c2 = CG.makeContext(5,[2,3]);
val c3 = CG.makeContext(5,[3,4]);

val ast1 = BJKParser.parse("sample1.core");
val ast2 = BJKParser.parse("sample2.core");
val mat1 = ref (Pol.analyse(ast1));
val mat2 = ref (Pol.analyse(ast2));

val e1 = CG.E (c1,c2, mat1);
val e2 = CG.E (c2,c3, mat2);
val e3 = CG.E (c1,c2, mat2);
val e4 = CG.E (c3,c2, mat1);

val g = CG.newGraph([e1, e2]);
val g1 = CG.newGraph([e3, e4]);

val g2 = CG.compose(g,g1);
val g3 = CG.join(g1,g);


CG.prtEdges(g);
CG.prtEdges(g1);
CG.prtEdges(g2);
CG.prtEdges(g3);

